package ${packagePrefix}.infrastructure.converter;

import ${packagePrefix}.domain.model.${tableName?lower_case}.${domainObjectName};
import ${packagePrefix}.infrastructure.dataobject.${domainObjectName}DO;
import org.mapstruct.*;

/**
 * ${entityComment}领域对象转换器
 * 使用MapStruct自动生成对象转换代码
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ${domainObjectName}Converter {

    /**
     * 数据对象转领域对象
     */
    ${domainObjectName} toDomain(${domainObjectName}DO dataObject);

    /**
     * 领域对象转数据对象
     */
    ${domainObjectName}DO toDO(${domainObjectName} domain);

    /**
     * 更新数据对象
     */
    @Mapping(target = "id", ignore = true)
<#if hasDateFields>
    @Mapping(target = "createTime", ignore = true)
</#if>
    void updateDO(@MappingTarget ${domainObjectName}DO target, ${domainObjectName} source);
} 